Skip to content

feat: add plugin marketplace API (#469)#576

Merged
greatest0fallt1me merged 1 commit into
CalloraOrg:mainfrom
Abba073:feature/plugin-marketplace
Jun 29, 2026
Merged

feat: add plugin marketplace API (#469)#576
greatest0fallt1me merged 1 commit into
CalloraOrg:mainfrom
Abba073:feature/plugin-marketplace

Conversation

@Abba073

@Abba073 Abba073 commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements the community plugin marketplace API for billing rule plugins, resolving #469.

Changes

New files:

  • src/services/pluginRegistry.tspluginManifestSchema (Zod), InMemoryPluginRepository, executeHook sandbox stub
  • src/routes/marketplace/plugins.ts — 5 REST endpoints with auth + audit logging
  • src/routes/marketplace/plugins.test.ts — 46 tests

Modified:

  • src/app.ts — mount /api/marketplace/plugins
  • docs/openapi.jsonPluginManifest + PluginRecord schemas, 4 path entries

Endpoints

Method Path Auth Description
GET /api/marketplace/plugins No List all plugins
POST /api/marketplace/plugins Yes Register plugin (manifest validation)
GET /api/marketplace/plugins/:id No Get plugin by ID
POST /api/marketplace/plugins/:id/install Yes Install + fire sandboxed hook
DELETE /api/marketplace/plugins/:id/install Yes Uninstall
DELETE /api/marketplace/plugins/:id Yes Remove from registry

Acceptance Criteria

  • CRUD works (list, register, get, install, uninstall, delete)
  • Manifest schema enforced (id format, semver, hooks enum, optional URL)
  • Install hook fires (executeHook sandbox stub — validates declared hooks, no arbitrary exec)
  • Audit logged (logger.audit on register, install, uninstall, delete)
  • Auth enforced on all mutating routes via requireAuth
  • OpenAPI spec updated

Test Output

Tests:    46 passed, 46 total
Coverage: pluginRegistry.ts 100% | plugins.ts 96.29%
Overall:  97.82% statements, 100% branches, 100% functions

Closes CalloraOrg#469

- POST   /api/marketplace/plugins          — register a plugin (auth, Zod manifest validation)
- GET    /api/marketplace/plugins          — list all plugins
- GET    /api/marketplace/plugins/:id      — get single plugin
- POST   /api/marketplace/plugins/:id/install    — install + fire sandboxed hook (auth)
- DELETE /api/marketplace/plugins/:id/install    — uninstall (auth)
- DELETE /api/marketplace/plugins/:id            — remove from registry (auth)

Services:
- pluginManifestSchema: Zod schema (id, name, version, semver, hooks enum)
- InMemoryPluginRepository: list/register/install/uninstall/delete
- executeHook: sandboxed stub (no arbitrary code; validates declared hooks only)
- All state changes audit-logged via logger.audit()

Tests: 46 tests, 97.82% coverage (pluginRegistry.ts at 100%)
OpenAPI: added PluginManifest + PluginRecord schemas and 4 path entries
@drips-wave

drips-wave Bot commented Jun 28, 2026

Copy link
Copy Markdown

@Abba073 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@greatest0fallt1me greatest0fallt1me merged commit a3517d5 into CalloraOrg:main Jun 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants